ALTER  PROC sp_load_all_po_products AS
BEGIN
	DECLARE @results TABLE( Part_Number VARCHAR(100), ProcessStep_Id INT )
	INSERT @results	SELECT CASE PS_Type_Name 
	WHEN 'TEST' THEN Product.Part_Number+'/'+PS_Type
	WHEN 'SORT' THEN Product.Part_Number+'/'+PS_Type
	ELSE Product.Part_Number END AS Part_Number, Product.ProcessStep_Id FROM Product, Process_Step WHERE Product.ProcessStep_Id = Process_Step.ProcessStep_Id AND
	PS_Type_Name IN ( 'FAB', 'SORT', 'ASSEMBLY', 'TEST'  )

	SELECT * FROM @results ORDER BY Part_Number
END